package net.lucamasini.ricette.client.ingredienti.event;

import java.util.List;

import net.lucamasini.ricette.client.ingredienti.IngredienteProxy;

import com.google.gwt.event.shared.EventHandler;
import com.google.gwt.event.shared.GwtEvent;

public class NewListaIngredientiEvent extends GwtEvent<NewListaIngredientiEvent.Handler> {

	public static interface Handler extends EventHandler {
		void onNewListaIngredientiResponse(NewListaIngredientiEvent event);
	}

	public final static Type<Handler> TYPE = new Type<NewListaIngredientiEvent.Handler>();

	private final List<IngredienteProxy> listaIngredienti;
	
	public NewListaIngredientiEvent(List<IngredienteProxy> listaIngredienti) {
		this.listaIngredienti = listaIngredienti;
	}

	@Override
	public Type<Handler> getAssociatedType() {
		return TYPE;
	}

	@Override
	protected void dispatch(Handler handler) {
		handler.onNewListaIngredientiResponse(this);
	}

	public List<IngredienteProxy> getListaIngredienti() {
		return listaIngredienti;
	}
}
